import QtQuick 1.0

Rectangle {
    width: 800
    height: 800
    id: page
    color: "black"

    signal startPlayback1();
    signal startPlayback2();
    signal startRecording(string user, string desc);

    property int playback1: 0;
    property int eeg: 0;
    property int playback2: 0;

    Grid
    {
        rows: 2
        columns: 2
        Rectangle
        {
            color: {if (page.playback1 == 1) return "green"; if (page.playback2 == 1) return "gray"; return "red";}
            width: 400
            height: 300
            MouseArea
            {
                anchors.fill: parent
                onClicked:
                {
                    if (page.playback2 == 0)
                    {
                        page.playback1 = 1;
                        page.startPlayback1();
                    }

                }
            }
            Text
            {
                anchors.centerIn: parent
                text: "audio option 1"
            }

        }
        Rectangle
        {
            color: {if (page.playback2 == 1) return "green"; if (page.playback1 == 1) return "gray"; return "red";}
            width: 400
            height: 300
            MouseArea
            {
                anchors.fill: parent
                onClicked:
                {
                    if (page.playback1 == 0)
                    {
                        page.playback2 = 1;
                        page.startPlayback2();
                    }
                }
            }
            Text
            {
                anchors.centerIn: parent
                text: "audio option 2"
            }

        }


        Rectangle
        {
            color: {if (page.eeg == 0) return "red"; return "green";}
            width: 400
            height: 300
            MouseArea
            {
                anchors.fill: parent
                onClicked:
                {
                    page.eeg = 1;
                    page.startRecording("android","android");
                }
            }
            Text
            {
                anchors.centerIn: parent
                text: "eeg"
            }

        }

    }




}
